import zrender from 'zrender/zrender'
import Line from 'zrender/graphic/shape/Line'

export default {
  mounted() {
    const zr = zrender.init(this.$refs.chart)
    const shape = new Line({
      shape: {
        x1: 0,
        y1: 0,
        x2: 800,
        y2: 600,
      },
      style: {
        stroke: 'green',
        lineWidth : 2,
        type: 'dashed',
        text : 'line'
      },
      draggable:true
    })
    zr.add(shape)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
